package com.tanguy.user.bean;

import android.text.TextUtils;

/**
 * Created by dab on 2017/11/2 0002 17:01
 */

public class DriverRegister {
    /**
     * server	String	是	app/league/driverLeague
     * name	string	是	姓名
     * sex	short	是	性别 1=男 2=女
     * idcard	string	是	身份证
     * drivage	string	是	驾龄
     * licence	string	是	驾驶证
     * modelId	string	是	车型ID
     * color	string	是	车辆颜色
     * plate	string	是	车牌号
     * careful	string	是	年审时间
     * travel	string	是	行驶证
     * insurance	string	是	保险
     * peoplecar	string	是	人车合影
     * id	string	是	用户ID
     */
    private String name;            //姓名
    private int sex;                //性别 1=男 2=女
    private String idcard;          //身份证
    private String drivage;         //驾龄
    private String licence;         //驾驶证
    private String modelId;         //车型ID
    private String modelString;     //车型String
    private String color;           //车辆颜色
    private String plate;           //车牌号=plateArea+plateNumber
    private String careful;         //年审时间
    private String travel;          //行驶证
    private String insurance;       //保险
    private String peoplecar;       //人车合影
    private String plateArea;       //车牌号前缀
    private String licenceUrl;      //驾驶证url
    private String travelUrl;       //行驶证url
    private String insuranceUrl;    //保险url
    private String peoplecarUrl;    //人车合影url
    private String plateNumber;     //车牌号后缀
    private String sexString;       //性别的字符串
    private String seat;            //座位数

    public String getName() {
        return name;
    }

    public int getSex() {
        if (TextUtils.isEmpty(sexString)) {
            return 0;
        }
        return "男".equals(sexString) ? 1 : 2;
    }

    public String getIdcard() {
        return idcard;
    }

    public String getDrivage() {
        return drivage;
    }

    public String getLicence() {
        return licence;
    }

    public String getModelId() {
        return modelId;
    }

    public String getColor() {
        return color;
    }

    public String getPlate() {
        return getPlateArea() + getPlateNumber();
    }

    public String getCareful() {
        return careful;
    }

    public String getTravel() {
        return travel;
    }

    public String getInsurance() {
        return insurance;
    }

    public String getPeoplecar() {
        return peoplecar;
    }

    public DriverRegister setName(String name) {
        this.name = name;
        return this;
    }

    public DriverRegister setIdcard(String idcard) {
        this.idcard = idcard;
        return this;
    }

    public DriverRegister setDrivage(String drivage) {
        this.drivage = drivage;
        return this;
    }

    public DriverRegister setLicence(String licence) {
        this.licence = licence;
        return this;
    }

    public DriverRegister setModelId(String modelId) {
        this.modelId = modelId;
        return this;
    }

    public DriverRegister setColor(String color) {
        this.color = color;
        return this;
    }


    public DriverRegister setCareful(String careful) {
        this.careful = careful;
        return this;
    }

    public DriverRegister setTravel(String travel) {
        this.travel = travel;
        return this;
    }

    public DriverRegister setInsurance(String insurance) {
        this.insurance = insurance;
        return this;
    }

    public DriverRegister setPeoplecar(String peoplecar) {
        this.peoplecar = peoplecar;
        return this;
    }

    public String getPlateArea() {
        return plateArea == null ? "" : plateArea;
    }

    public DriverRegister setPlateArea(String plateArea) {
        this.plateArea = plateArea;
        return this;
    }

    public String getPlateNumber() {
        return plateNumber == null ? "" : plateNumber;
    }

    public DriverRegister setPlateNumber(String plateNumber) {
        this.plateNumber = plateNumber;
        return this;
    }

    public String getSeat() {
        return seat;

    }

    public DriverRegister setSeat(String seat) {
        this.seat = seat;
        return this;
    }

    public String getSexString() {
        return sexString;
    }

    public DriverRegister setSexString(String sexString) {
        this.sexString = sexString;
        this.sex = "男".equals(sexString) ? 1 : 2;
        return this;
    }

    public String getModelString() {
        return modelString;
    }

    public DriverRegister setModelString(String modelString) {
        this.modelString = modelString;
        return this;
    }

    public String getLicenceUrl() {
        return licenceUrl;
    }

    public void setLicenceUrl(String licenceUrl) {
        this.licenceUrl = licenceUrl;
    }

    public String getTravelUrl() {
        return travelUrl;
    }

    public void setTravelUrl(String travelUrl) {
        this.travelUrl = travelUrl;
    }

    public String getInsuranceUrl() {
        return insuranceUrl;
    }

    public void setInsuranceUrl(String insuranceUrl) {
        this.insuranceUrl = insuranceUrl;
    }

    public String getPeoplecarUrl() {
        return peoplecarUrl;
    }

    public void setPeoplecarUrl(String peoplecarUrl) {
        this.peoplecarUrl = peoplecarUrl;
    }

    public DriverRegister() {
    }

    @Override
    public String toString() {
        return "DriverRegister{" +
                "name='" + name + '\'' +
                ", sex=" + sex +
                ", idcard='" + idcard + '\'' +
                ", drivage='" + drivage + '\'' +
                ", licence='" + licence + '\'' +
                ", modelId='" + modelId + '\'' +
                ", modelString='" + modelString + '\'' +
                ", color='" + color + '\'' +
                ", plate='" + plate + '\'' +
                ", careful='" + careful + '\'' +
                ", travel='" + travel + '\'' +
                ", insurance='" + insurance + '\'' +
                ", peoplecar='" + peoplecar + '\'' +
                ", plateArea='" + plateArea + '\'' +
                ", licenceUrl='" + licenceUrl + '\'' +
                ", travelUrl='" + travelUrl + '\'' +
                ", insuranceUrl='" + insuranceUrl + '\'' +
                ", peoplecarUrl='" + peoplecarUrl + '\'' +
                ", plateNumber='" + plateNumber + '\'' +
                ", sexString='" + sexString + '\'' +
                ", seat='" + seat + '\'' +
                '}';
    }
}
